#pragma once
#define  ZN_UP_NUM_NEW   WM_USER+685
#define  ZN_UP_ONE_NEW   WM_USER+686
#include "ZNHttpclient.h"
//#include "ZNCurlHttp.h"

class DownloadInterface
{
private:
    static DownloadInterface* m_instance;

public:
	static DownloadInterface* Instance() {
        if (m_instance == nullptr) {
            //std::lock_guard<std::mutex> lock(m_mutex);
            if (m_instance == nullptr) {
                m_instance = new DownloadInterface();
            }
        }
        return m_instance;
    }

public:
	int	Download(std::string strID, std::string strPath, std::string strName, DownloadTask *task,
		int (*progress_callback)(void*, curl_off_t, curl_off_t, curl_off_t, curl_off_t));
	bool GetFileList(std::string strMachineID, std::string strVersionID, std::string & strResponse);
	bool GetSofVersionList(std::string strMachineID, std::string & strResponse);
	bool GetMaxSofVersion(std::string strMachineID, std::string & strResponse);
	bool GetVersionByID(std::string strVersion, std::string & strResponse);
	bool GetMachineList(std::string & strResponse);

public:
	std::string m_strIP;
	std::string m_strPort;
};